﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GoodClassList.aspx.cs"
    Inherits="WebSystemAdmin.GoodClass.GoodClassList" %>

<%@ Import Namespace="Enter.Common" %>
<%@ Import Namespace="Enter.Enity" %>
<%@ Import Namespace="Enter.Config" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../css/admin_css.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function changetrStatus(obj) {
            var display = document.getElementById("tr_" + obj.id).style.display;
            document.getElementById("tr_" + obj.id).style.display = display == "none" ? "" : "none";
            document.getElementById("img_" + obj.id).src = display == "none" ? "../images/z_jian.gif" : "../images/y_jia.gif";

        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table class="tb_data" cellpadding="0" cellspacing="1">
            <tr class="tr_title">
                <th colspan="9">
                    <a href="GoodClassEdit.aspx" class="A_Add">添加</a>
                </th>
            </tr>
            <tr class="tr_head">
                <td>
                </td>
                <td>
                    编号
                </td>
                <td>
                    名称
                </td>
                <td>
                    权重
                </td>
                <td>
                    状态
                </td>
                <td>
                    操作
                </td>
            </tr>
            <asp:Repeater ID="rp_Data" runat="server" OnItemCommand="rp_Data_ItemCommand" OnItemDataBound="rp_Data_ItemDataBound">
                <ItemTemplate>
                    <tr class='tr_content_o'>
                        <td>
                            <div style="cursor: pointer; padding-left: 5px" id='<%#Eval("CID")%>' onclick="changetrStatus(this)">
                                <img id="img_<%#Eval("CID") %>" src="../images/y_jia.gif" />
                            </div>
                        </td>
                        <td>
                            <asp:Label ID="lbl_CNO" runat="server" Text='<%#Eval("CNO")%>'></asp:Label>
                        </td>
                        <td>
                            <a href='GoodClassEdit.aspx?CID=<%#Eval("CID")%>'>
                                <asp:Label ID="lbl_CName" runat="server" Text='<%#Eval("CName")%>'></asp:Label>
                            </a>
                            <asp:Label ID="lbl_CID" Visible="false" runat="server" Text='<%#Eval("CID")%>'></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="lbl_Weight" runat="server" Text='<%#Eval("Weight")%>'></asp:Label>
                        </td>
                        <td>
                            <asp:Label ID="lbl_Status" runat="server" Text='<%# EnumHelper.GetEnumCNNameFromEnum((EnumStatus)(byte)Eval("Status"))%>'></asp:Label>
                        </td>
                        <td>
                            <div>
                                <a href='GoodClassEdit.aspx?ParentID=<%#Eval("CNO")%>' class="A_edit">添加子类</a>
                            </div>
                            </div>
                        </td>
                    </tr>
                    <tr style="display: none; background-color: White" id='tr_<%#Eval("CID")%>'>
                        <td colspan="5">
                            <table class="tb_data" style="padding-left: 40px; background-color: White" cellpadding="0"
                                cellspacing="1">
                                <asp:Repeater ID="rp_Datach" runat="server" OnItemDataBound="rp_Datach_ItemDataBound">
                                    <ItemTemplate>
                                        <tr class='tr_content_j'>
                                            <td>
                                                <div style="cursor: pointer; padding-left: 5px" id='c<%#Eval("CID")%>' onclick="changetrStatus(this)">
                                                    <img id="img_c<%#Eval("CID") %>" src="../images/y_jia.gif" />
                                                </div>
                                            </td>
                                            <td>
                                                <asp:Label ID="lbl_CNO" runat="server" Text='<%#Eval("CNO")%>'></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Label ID="lbl_CID" Visible="false" runat="server" Text='<%#Eval("CID")%>'></asp:Label>
                                                <a href='GoodClassEdit.aspx?CID=<%#Eval("CID")%>&ParentID=<%#Eval("ParentID")%>'>
                                                    <asp:Label ID="lbl_CName" runat="server" Text='<%#Eval("CName")%>'></asp:Label></a>
                                            </td>
                                            <td>
                                                <img style=' display: <%#string.IsNullOrEmpty(Eval("icon").ToString())?"none":"" %>' src='<%#ImgPathConfig.GoodClassServerPath+Eval("icon")%>' />
                                            </td>
                                            <td>
                                                <asp:Label ID="lbl_Weight" runat="server" Text='<%#Eval("Weight")%>'></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Label ID="lbl_HitCount" runat="server" Text='<%#Eval("HitCount")%>'></asp:Label>
                                            </td>
                                            <td>
                                                <asp:Label ID="lbl_Status" runat="server" Text='<%# EnumHelper.GetEnumCNNameFromEnum((EnumStatus)(byte)Eval("Status"))%>'></asp:Label>
                                            </td>
                                            <td>
                                                <div>
                                                    <a href='GoodClassEdit.aspx?ParentID=<%#Eval("CNO")%>' class="A_edit">添加子类</a> <a
                                                        href='GoodClassPropertyList.aspx?ClassID=<%#Eval("CNO")%>' class="A_edit">添加属性</a>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr style="display: none; background-color: White" id='tr_c<%#Eval("CID")%>'>
                                            <td colspan="7">
                                                <table class="tb_data" cellpadding="0" style="padding-left: 50px; background-color: White"
                                                    cellspacing="1">
                                                    <asp:Repeater ID="rp_Datach1" runat="server">
                                                        <ItemTemplate>
                                                            <tr class='<%#Container.ItemIndex%2==0?"tr_content_j":"tr_content_o" %>'>
                                                                <td>
                                                                    <asp:Label ID="lbl_CNO" runat="server" Text='<%#Eval("CNO")%>'></asp:Label>
                                                                </td>
                                                                <td>
                                                                    <a href='GoodClassEdit.aspx?CID=<%#Eval("CID")%>&ParentID=<%#Eval("ParentID")%>'>
                                                                        <asp:Label ID="lbl_CName" runat="server" Text='<%#Eval("CName")%>'></asp:Label></a>
                                                                </td>
                                                                <td>
                                                                    <img style=' display: <%#string.IsNullOrEmpty(Eval("icon").ToString())?"none":"" %>' src='<%#ImgPathConfig.GoodClassServerPath+Eval("icon")%>' />
                                                                </td>
                                                                <td>
                                                                    <asp:Label ID="lbl_Weight" runat="server" Text='<%#Eval("Weight")%>'></asp:Label>
                                                                </td>
                                                                <td>
                                                                    <asp:Label ID="lbl_HitCount" runat="server" Text='<%#Eval("HitCount")%>'></asp:Label>
                                                                </td>
                                                                <td>
                                                                    <asp:Label ID="lbl_Status" runat="server" Text='<%# EnumHelper.GetEnumCNNameFromEnum((EnumStatus)(byte)Eval("Status"))%>'></asp:Label>
                                                                </td>
                                                                <td>
                                                                    <div>
                                                                        <a href='GoodClassPropertyList.aspx?ClassID=<%#Eval("CNO")%>' class="A_edit">添加属性</a>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </ItemTemplate>
                                                    </asp:Repeater>
                                                </table>
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </table>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:Repeater>
        </table>
    </div>
    </form>
</body>
</html>
